package com.ze.sys.job;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.ze.sys.entity.SysUser;
import com.ze.sys.service.SysUserService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class SampleXxlJob {
    @Resource
    private SysUserService sysUserService;

    /**
     * 简单任务示例  XxlJob 任务的 JobHandler*
     */
    @XxlJob("demoJobHandler")
    public void demoJobHandler() {
        SysUser sysUser = sysUserService.queryById(12L);
        System.out.println(sysUser.getName());
        System.out.println("sysUser" + sysUser.toString());
    }

}
